package com.wcgksoft.common.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Layui工具类代码
 * @author x1c
 *
 */
public class Layui extends HashMap<String, Object> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private static List<Object> dataList=new ArrayList<Object>();
	
	public static Layui data(Integer code,String msg,long count,List<?> data){
        Layui r = new Layui();
        r.put("code", code);
        r.put("msg", msg);
        r.put("count", count);
        r.put("data", data);
        return r;
    }


	public static Layui data(Integer code,String msg,Object obj){
		Layui r = new Layui();
		r.put("code", code);
		r.put("msg", msg);
		r.put("obj", obj);
		return r;
	}

	public static Layui data(Integer code,String msg,long count,List<?> data,Object result){
		Layui r = new Layui();
		r.put("code", code);
		r.put("msg", msg);
		r.put("count", count);
		r.put("data", data);
		r.put("result", result);
		return r;
	}
	public static List<Object> addList(Object e) {
		dataList.add(e);
		return dataList;
	}
}
